// Loads the RSS reader module
Rhy.dependency.load('../build/extra/youtube.rhy.js', 'youtube');

/* 
*  When the dependency is loaded, execute the code.
*  This code can be placed on the calling script or on the called script.
*  If placed in the called script, the dependency will only need the first load call
*  to be executed.
* 
*  A dependency is loaded once time only.
*/
Rhy.dependency.ready(
  'youtube', 
  function(){
      var youtube = new Rhy.extra.youtube();
      // Get the results of the "Vivaldi" search
      youtube.search("Vivaldi", {category : "Music"}, function(o){
          console.log(o);
      });

        // Let's get the most viewed video.
      youtube.standard("most_viewed", {"max-results" : 1}, function(o){
          console.log(o);
      });
    }
);  